#include<bits/stdc++.h>
using namespace std;
const int N=310;
int n;
char s[N];
char t[N];
int ans;
int sum[N];
int mnr[N];
bool check(){
    for(int i=1;i<=n;i++)sum[i]=sum[i-1]+(t[i]=='('?1:-1);
    mnr[n]=sum[n];
    for(int i=n;i>=1;i--)mnr[i-1]=min(mnr[i],sum[i-1]);
    if(sum[n]==0&&mnr[0]==0)return 1;
    for(int i=0;i<n;i++){
        if(sum[i]<0)break;
        int mx=sum[i];
        for(int j=i+1;j<=n;j++){
            mx=max(mx,sum[j]);
            if(mx-sum[i]>sum[i])break;
            if(mnr[j]<sum[n])continue;
            if(sum[n]+2*sum[i]-2*sum[j]!=0)continue;
            return 1;
        }
    }
    return 0;
}
void dfs(int i){
    if(i>n){
        ans+=check();
        return;
    }
    t[i]=s[i];
    if(t[i]=='x'){
        t[i]='(';
        dfs(i+1);
        t[i]=')';
        dfs(i+1);
    }
    else dfs(i+1);
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    freopen("bracket.in","r",stdin);
    freopen("bracket.out","w",stdout);
    cin>>n>>s+1;
    dfs(1);
    cout<<ans;
    return 0;
}
